home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 32 / cadence.zip / VOL1NO3.ZIP / SIDEVIEW.LSP < prev    next >
Text File  |  1987-05-18  |  3KB  |  81 lines

  1. ; =================================================================
  2. ;   Side View Macro          SIDEVIEW.LSP
  3. ;   Bill Kramer     For Version 2.18 of AutoCAD.
  4. ;
  5. ;      Functions:   SVSTRT   Initialize Siew View
  6. ;                   SVZSET   Set up the Z values for the side view
  7. ;                   SVLINE   Draw lines on top and side view
  8. ;
  9. ;      To load macro, enter the AutoLISP Command:
  10. ;             (load "sideview")
  11. ;
  12. ;      The file SIDEVIEW.LSP should be in the current directory.
  13. ;
  14. ;==================================================================
  15. (defun c:svstrt ()
  16.    (setq zbase (getreal "\nY axis value for Z=0 <0.0>: "))
  17.    (if (null zbase) (setq zbase 0.0))
  18.    (setvar "CMDECHO" 0)
  19. )
  20. ; -----------------------------------------------------------------
  21. (defun c:svzset ()
  22.    (setq tz (getreal "\nStarting Elevation bottom:")) ; Z1 value?
  23.    (cond ((null tz)  ; No entry, use CP or ZBASE values.
  24.              (if (null cp) ; Current point equal to nil?
  25.                    (setq pp (list zbase zbase)) ; Use base value.
  26.                    (setq pp cp) ; Set elevations from current point.
  27.              )
  28.          )
  29.          (t          ; User entry made, ask for Z2 value.
  30.              (setq pp (+ tz zbase)) ; Add offset to entry, put in PP.
  31.              (setq tz (getreal "\nStarting Elevation top:"))
  32.              (if (null tz); No Input read?
  33.                         (setq pp (list pp pp)) ; Use Bottom entry.
  34.                         (setq pp (list pp (+ tz zbase))) ;Add offset
  35.              )
  36.          )
  37.    )
  38.    (setq tz (getreal "\nEnding Elevation bottom:"))
  39.    (cond ((null tz) ; No user entry made, use previous point.
  40.                (setq cp pp)
  41.          )
  42.          (t  ; User made entry.
  43.              (setq cp (+ tz zbase)) ; Add offset and save in CP.
  44.              (setq tz (getreal "\nEnding Elevation top:"))
  45.              (if (null tz)  ; No input read?
  46.                       (setq cp (list cp cp)) ;Use bottom value for top.
  47.                       (setq cp (list cp (+ tz zbase))) ; Add offset.
  48.              )
  49.          )
  50.    )
  51. )
  52. ; ----------------------------------------------------------------
  53. (defun c:svline ()
  54.   (setq pp (list pp (getpoint "\nStarting Point:")))
  55.   (if (eq (cadr pp) nil) ; No input read?
  56.       (setq pp (list (car pp) (getvar "LASTPOINT"))) ; Use last point
  57.   )
  58.   (prompt "\nTo Point:")
  59.   (command "line" (cadr pp)) ; Start line command for Rubber band.
  60.   (setq cp (list cp (getpoint))) ; Build Current point list.
  61.   (while (not (eq (cadr cp) nil)) ; As long as points are entered.
  62.      (command (cadr cp) "") ; Finish line command for top view.
  63.      (if (= (caadr pp) (caadr cp))
  64.         (prompt "No change in X") ; No change in X, do not draw side view.
  65.         (command "line" (list (caadr pp) (caar pp))   ; Draw side view
  66.                         (list (caadr pp) (cadar pp))  ; Otherwise.
  67.                         (list (caadr cp) (cadar cp))
  68.                         (list (caadr cp) (caar cp))
  69.                         "c"
  70.         )
  71.      )
  72.      (setq pp cp) ; Set current point into previous point.
  73.      (prompt "\nTo Point:")
  74.      (command "line" (cadr pp)) ; Start line command for Rubber band.
  75.      (setq cp (list (car cp) (getpoint))) ; Build current point list.
  76.    )
  77.    (command "") ; Terminate the line command.
  78.    (setq pp (car pp)) ; Set lists to Z vector data only.
  79.    (setq cp (car cp))
  80. )
  81.